#define the number of nodes to use
PROCESSOR_CNT=5 
#define how many queens
N_QUEENS=8
#define the depth of Master node to find solutions
K_DEPTH=3

CC=mpicc
CFLAGS=-c -O2 -Wall -DPROC_CNT=$(PROCESSOR_CNT) -DN=$(N_QUEENS) -DK=$(K_DEPTH)
LDFLAGS=
SOURCES=n_queens.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=n_queens

all: clean $(EXECUTABLE) 
	
$(EXECUTABLE): $(OBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.c.o:
	$(CC) $(CFLAGS) $< -o $@

clean: 
	rm -vf *.o  *.txt tag $(EXECUTABLE)

run: 
	mpirun -np $(PROCESSOR_CNT) ./$(EXECUTABLE) 
brun: 
	bmpirun -np $(PROCESSOR_CNT) ./$(EXECUTABLE) 
